import {Routes, RouterModule} from "@angular/router";
import {CrisisListComponent} from "../crisis-list/crisis-list.component";
import {CrisisAdminComponent} from "../crisis-center/crisis-admin.component";
import {AuthGuard} from "../services/auth-guard.service";
import {CrisisDetailComponent} from "../crisis-center/crisis-detail.component";
import {CrisisCenterComponent} from "../crisis-center/crisis-center.component";

const crisisCenterRoutes: Routes = [
  {
    path: '',
    component: CrisisCenterComponent,
    children: [{
      path: 'admin',
      component: CrisisAdminComponent,
      canActivate: [AuthGuard]
    }, {
      path: 'id',
      component: CrisisDetailComponent,
      canDeactivate: []
    }, {
      path: '',
      component: CrisisListComponent
    }]
  }
]

export const crisisCenterRouting = RouterModule.forChild(crisisCenterRoutes)